package com.gaofeng.day09;



import com.gaofeng.day07.Student;

import java.util.ArrayList;
import java.util.Collection;

public class Demo02 {
    public static void main(String[] args) {
        // Student
        Collection<Student> cl = new ArrayList<>();

        Student s1 = new Student("aaa", 10);
        Student s2 = new Student("bbb", 20);
        Student s3 = new Student("ccc", 30);
        cl.add(s1);
        cl.add(s2);
        cl.add(s3);
        System.out.println(cl);

        Student s4 = new Student("aaa", 10);
        boolean contains = cl.contains(s4);
        System.out.println(contains);

        boolean empty = cl.isEmpty();
        System.out.println(empty);

        int size = cl.size();
        System.out.println(size);


        /*[Student{name='aaa', age=10}, Student{name='bbb', age=20}, Student{name='ccc', age=30}]
        true
        false
        3*/
    }
}
